
import 'package:fate_blind_box/theme/theme_color.dart';
import 'package:fate_blind_box/utils/common_widget.dart';
import 'package:fate_blind_box/utils/snack_bar.dart';
import 'package:flutter/material.dart';

class AccountModifyUi extends StatelessWidget {
  const AccountModifyUi({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return AppWidget.navTitleBar(
      bgColor: Colors.white,
      title: "找回登录密码",
      childWidget:const _AccountModify(),
    );
  }
}

class _AccountModify extends StatefulWidget {
  const _AccountModify({Key? key}) : super(key: key);

  @override
  State<_AccountModify> createState() => _AccountModifyState();
}

class _AccountModifyState extends State<_AccountModify> {
  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        Container(
          margin: const EdgeInsets.only(left: 20.0, top: 64.0),
          child: Text(
            "设置密码",
            style: TextStyle(
              color: ThemeColor.textColor,
              fontSize: 30,
            ),
          ),
        ),
        //  输入密码
        Container(
          margin: const EdgeInsets.only(left: 20.0, top: 28.0, right: 24.0),
          height: 48,
          child: TextField(
            maxLength: 16,
            obscureText: true,
            keyboardType: TextInputType.text,
            cursorColor: ThemeColor.mainColor,
            style: TextStyle(
                fontSize: 18,
                color: ThemeColor.textColor
            ),
            decoration: InputDecoration(
                hintText: "请输入新密码",
                counterText: "",
                border: InputBorder.none,
                hintStyle: TextStyle(color: ThemeColor.textColorSecond),
                focusedBorder: const UnderlineInputBorder(
                    borderSide: BorderSide(color: Color(0xFFEBEBEB))
                ),
                enabledBorder: const UnderlineInputBorder(
                    borderSide: BorderSide(color: Color(0xFFEBEBEB))
                )
            ),
          ),
        ),
        // 再次输入密码
        Container(
          margin: const EdgeInsets.only(left: 20.0, top: 8.0, right: 20.0),
          height: 48,
          child: TextField(
            maxLength: 16,
            obscureText: true,
            keyboardType: TextInputType.text,
            cursorColor: ThemeColor.mainColor,
            style: TextStyle(
                fontSize: 18,
                color: ThemeColor.textColor
            ),
            decoration: InputDecoration(
                hintText: "请再次输入新密码",
                counterText: "",
                border: InputBorder.none,
                hintStyle: TextStyle(color: ThemeColor.textColorSecond),
                focusedBorder: const UnderlineInputBorder(
                    borderSide: BorderSide(color: Color(0xFFEBEBEB))
                ),
                enabledBorder: const UnderlineInputBorder(
                    borderSide: BorderSide(color: Color(0xFFEBEBEB))
                )
            ),
          ),
        ),
        // 确认按钮
        GestureDetector(
          onTap: () => {
            ThemeSnackBar.show(context, "修改成功")
          },
          child: Container(
            margin: const EdgeInsets.only(left: 20.0, top: 50.0, right: 20.0),
            height: 48,
            decoration: ShapeDecoration(
                shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(24)),
                color: ThemeColor.mainColor
            ),
            child: const Center(
              child: Text(
                "确定",
                style: TextStyle(
                    color: Colors.white,
                    fontSize: 15
                ),
              ),
            ),
          )
        ),
      ],
    );
  }
}

